package svc

import (
	"api/internal/config"
	"github.com/zeromicro/go-zero/zrpc"
	"rpc/pb/rpc"
	"rpc/rpcclient"
)

type ServiceContext struct {
	Config config.Config
	Rpc    rpcclient.Rpc
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config: c,
		Rpc:    rpc.RpcClient(rpcclient.NewRpc(zrpc.MustNewClient(c.Rpc))),
	}
}
